package com.gifts.ui.page.selectaProduct;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

import com.gifts.ui.page.common.JThumbnail;
/**
 * UI class for displaying interests
 * @author kevin
 *
 */
public class JListInterestsPanel extends JPanel {

	private JThumbnail thumbnail;
	private JComboBox interestCombobox;
	//private JList interstList;
	private JTextField interestTextField;
	private JButton submitButton;
	private JButton clearButton;
	JLabel interestLabel;
	
	private JLabel noResult;

	public JListInterestsPanel() {

		thumbnail = new JThumbnail();
		setBorder(BorderFactory.createTitledBorder("List Suggestion"));
		BoxLayout layout = new BoxLayout(this, BoxLayout.X_AXIS);
		setLayout(layout);
		
		JPanel mainPanel = new JPanel();
		FlowLayout flowLayout = new FlowLayout();
		mainPanel.setLayout(flowLayout);
		
		noResult = new JLabel("has no interests. Suggest GIFT CARD...");
		noResult.setForeground(Color.RED);
		JPanel interestMainPanel = new JPanel();
		FlowLayout flowLayoutMain =  new FlowLayout();
		interestMainPanel.setLayout(flowLayoutMain);
		flowLayoutMain.setAlignment(FlowLayout.LEFT);
		interestMainPanel.setPreferredSize(new Dimension(300, 500));
		
		
		
		JPanel interestListPanel = new JPanel();
		interestListPanel.setLayout(new FlowLayout());
		interestLabel = new JLabel("Interested In:");
		
//		interstList = new JList();
//		JScrollPane intrestScrollPanel = new JScrollPane(interstList);
//		interstList.setSize(new Dimension(100,200));
//		interstList.setPreferredSize(new Dimension(100, 120));
//		
//		interestListPanel.add(interestLabel);
//		interestListPanel.add(intrestScrollPanel);
//		
		
		interestCombobox  = new JComboBox();
		
		JPanel textInterestPanel = new JPanel();
		textInterestPanel.setLayout(new FlowLayout());
		
		submitButton = new JButton("Submit");
		//clearButton = new JButton("Clear");
		
		interestTextField = new JTextField(10);
		
		JLabel suggestionLabel = new JLabel("Suggest an Interest:");
		textInterestPanel.add(suggestionLabel);
		textInterestPanel.add(interestTextField);
		textInterestPanel.add(submitButton);
		//textInterestPanel.add(clearButton);
		interestMainPanel.add(thumbnail);
		interestMainPanel.add(interestLabel);
		interestMainPanel.add(interestCombobox);
		interestMainPanel.add(noResult);
		interestMainPanel.add(textInterestPanel);
		
		add(interestMainPanel);
		
		
		
		
		
		
	}
	
	public JTextField getInterestTextField() {
		return interestTextField;
	}
	
	
	public JButton getSubmitButton() {
		return submitButton;
	}
	
	public JButton getClearButton() {
		return clearButton;
	}
	
//	public JList getInterestList() {
//		return interstList;
//	}
	
	public JComboBox getInterestComboBox() {
		return interestCombobox;
	}
	
	public JThumbnail getJThumbnail() {
		return thumbnail;
	}
	
	public JLabel getInterestLabel() {
		return interestLabel;
	}
	
	public JLabel getNoResultLabel() {
		return noResult;
	}

}
